package com.kaf.ai.dto;

import lombok.Data;

import java.util.List;

@Data
public class ChatResponseChunk {

    private String id;
    private String object;
    private long created;
    private String model;
    private String system_fingerprint;
    private Choice[] choices;
    private Usage usage; // 新增字段

    @Data
    public static class Choice {
        private int index;
        private Delta delta;
        private Object logprobs; // 可能是对象或null
        private String finish_reason; // 结束原因

        @Data
        public static class Delta {
            private String role;
            private String content;
        }
    }

    @Data
    public static class Usage {
        private int prompt_tokens;
        private int completion_tokens;
        private int total_tokens;
        private PromptTokensDetails prompt_tokens_details;
        private int prompt_cache_hit_tokens;
        private int prompt_cache_miss_tokens;

        @Data
        public static class PromptTokensDetails {
            private int cached_tokens;
        }
    }
}
